package com.shuhe.domain.mxgc;

import java.util.ArrayList;

public class SqlRequestBody {
    private String sql;
    private ArrayList<SqlResponseResultMeta> metas = new ArrayList<SqlResponseResultMeta>();
    private ArrayList<String> fileDatas = new ArrayList<String>();
    private String operateType;
    private String tableName;
    private String langType;
    private String tableComment;
    private String userName;
    //加密类型0：石家庄市局加密 1：不加密
    private String encyptType;
    private String password;
    private String mxnr;
    private String mxsm;
    private String mxmc;
    private String mxid;
    private String mlid;
    //目录增删改用
    private String dirTitle;
    private String dirParentKey;
    private String dirOrder;
    private String mxtp;
    //0代表否 1代表是
    private String sfbq;
    private String bqmlid;
    //申请共享类型 0 模型 1 标签 2分析 3看板
    private String applyType;
    private String applyId;
    //输入表列表
    private String inputTables;

    private String tableWhere;
    private String dbWhere;

    private String bz;

    public String getBz() {
        return bz;
    }

    public void setBz(String bz) {
        this.bz = bz;
    }

    public String getEncyptType() {
        return encyptType;
    }

    public void setEncyptType(String encyptType) {
        this.encyptType = encyptType;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getDbWhere() {
        if (dbWhere == null) {
            dbWhere = "";
        }
        return dbWhere;
    }

    public void setDbWhere(String dbWhere) {
        this.dbWhere = dbWhere;
    }

    public String getTableWhere() {
        if (tableWhere == null) {
            tableWhere = "";
        }
        return tableWhere;
    }

    public void setTableWhere(String tableWhere) {
        this.tableWhere = tableWhere;
    }

    public String getLangType() {
        if (langType == null || langType == "") {
            langType = "sql_";
        }
        return langType;
    }

    public void setLangType(String langType) {
        this.langType = langType;
    }


    //数据库类型 db mining
    private String dbType;

    public String getDbType() {
        return dbType;
    }

    public void setDbType(String dbType) {
        this.dbType = dbType;
    }

    public String getInputTables() {
        return inputTables;
    }

    public void setInputTables(String inputTables) {
        this.inputTables = inputTables;
    }

    public String getApplyId() {
        return applyId;
    }

    public void setApplyId(String applyId) {
        this.applyId = applyId;
    }

    public String getApplyType() {
        return applyType;
    }

    public void setApplyType(String applyType) {
        this.applyType = applyType;
    }

    public String getSfbq() {
        if (sfbq == null) {
            return "0";
        } else {
            return sfbq;
        }
    }

    public void setSfbq(String sfbq) {
        this.sfbq = sfbq;
    }

    public String getBqmlid() {
        if (bqmlid == null) {
            return "300";
        } else {
            return bqmlid;
        }
    }

    public void setBqmlid(String bqmlid) {
        this.bqmlid = bqmlid;
    }

    public String getDirOrder() {
        return dirOrder;
    }

    public void setDirOrder(String dirOrder) {
        this.dirOrder = dirOrder;
    }

    public String getDirTitle() {
        return dirTitle;
    }

    public void setDirTitle(String dirTitle) {
        this.dirTitle = dirTitle;
    }

    public String getDirParentKey() {
        return dirParentKey;
    }

    public void setDirParentKey(String dirParentKey) {
        this.dirParentKey = dirParentKey;
    }

    public String getMxtp() {
        if (mxtp == null) {
            return "";
        } else {
            return mxtp;
        }

    }

    public void setMxtp(String mxtp) {
        this.mxtp = mxtp;
    }

    public String getMxsm() {
        return mxsm;
    }

    public void setMxsm(String mxsm) {
        this.mxsm = mxsm;
    }

    public ArrayList<String> getFileDatas() {
        return fileDatas;
    }

    public void setFileDatas(ArrayList<String> fileDatas) {
        this.fileDatas = fileDatas;
    }

    public String getMlid() {
        return mlid;
    }

    public void setMlid(String mlid) {
        this.mlid = mlid;
    }

    public String getMxid() {
        if (mxid == null) {
            mxid = "";
        }
        return mxid;
    }

    public void setMxid(String mxid) {
        this.mxid = mxid;
    }

    public String getMxmc() {
        return mxmc;
    }

    public void setMxmc(String mxmc) {
        this.mxmc = mxmc;
    }

    public String getMxnr() {
        if (mxnr == null) {
            mxnr = "";
        }
        String replMxnr = mxnr.replaceAll("[\\r\\n\\t]", "")
                .replaceAll("\\\\r", "")
                .replaceAll("\\\\n", "")
                .replaceAll("\\\\t", "")
                .replaceAll("'", "''")
                .replaceAll("\\\"", "\\\\\"");
        return replMxnr;
    }

    public void setMxnr(String mxnr) {
        this.mxnr = mxnr;
    }

    public String getTableComment() {
        return tableComment;
    }

    public void setTableComment(String tableComment) {
        this.tableComment = tableComment;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getOperateType() {
        return operateType;
    }

    public void setOperateType(String operateType) {
        this.operateType = operateType;
    }

    public ArrayList<SqlResponseResultMeta> getMetas() {
        return metas;
    }

    public void setMetas(ArrayList<SqlResponseResultMeta> metas) {
        this.metas = metas;
    }

    public String getSql() {
        if (sql == null) {
            sql = "";
        }
        return sql;
    }

    public void setSql(String sql) {
        this.sql = sql;
    }

    public static void main(String[] args) {
        String str = "";

        System.out.println(str.indexOf("\\\t"));
        System.out.println(str.indexOf("\\t"));
        System.out.println(str.indexOf("\t"));
        System.out.println(str.indexOf("/t"));

        System.out.println(str);
        str = str.replaceAll("[\r\n\t]", "");
        System.out.println(str);

        System.out.println(str.indexOf("\\\t"));
        System.out.println(str.indexOf("\\t"));
        System.out.println(str.indexOf("\t"));
        System.out.println(str.indexOf("/t"));

    }
}
